#!/bin/bash

remote_host=$1
login=$2
passwd=$3
remote_dir=$4

print_usage()
{
   echo "Usage: $0 <remote host> <login> <passwd> <remote dir>"
   echo "List the content of the given directory on the given"
   echo "remote host by using FTP protocol."
}

if [ "x$remote_dir" == "x" ]; then
   echo "[ERROR] All arguments not available."
   print_usage
   exit 1
fi

ftp  -n -v $remote_host <<EOFTP
quote USER $login
quote PASS $passwd
cd $remote_dir
ls
quit
EOFTP


